package com.bawei.common.mvi

import androidx.lifecycle.ViewModel
import com.bawei.common.state.RealContainer
import com.bawei.common.state.UiState

/**
 * @author ZhangRuiPeng
 * @description:
 */
abstract class BaseViewModel <REPO : BaseRepository,STATE : UiState> : ViewModel(){
    protected val  repo : REPO by lazy { createRepo() }
    private val state : STATE by lazy { createSTATE() }
    val  realContainer = RealContainer<STATE>(state)
    //创建对应当前viewmodel的BaseRepository对象
    abstract fun createRepo() : REPO
    //创建对应当前viewmodel的UIState对象
    abstract fun createSTATE() : STATE



























}






